package com.atguigu.springcloud.controller;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 *
 * controller组件
 * @author : zjj
 * @date : 2021/6/17 14:55
 */

@RestController
@Slf4j
public class SentinelController {

    @GetMapping("/testA")
    public String testA()
    {
        return "------testA";
    }

    @GetMapping("/testB")
    public String testB()
    {
        log.info(Thread.currentThread().getName() + "=======================testB");
        return "------testB";
    }

    @GetMapping("testD")
    public String testD(){

        try {
            TimeUnit.SECONDS.sleep(1);
        }catch (Exception e){
            e.printStackTrace();
        }
        log.info("测试 testD RT");
        return "testD";
    }

}
